package com.woniu.HisHospitalizationApi;

import com.woniu.dto.HisBedDto;
import com.woniu.dto.PageDTO;
import com.woniu.param.HisBedAddParam;
import com.woniu.param.HisBedParam;
import com.woniu.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;

@FeignClient(
        value = "his-hospitalization",
        contextId = "hisBed")
@Api(tags = "住院床位借口")
public interface HisBedApi {
    //-------------------关于床位记录操作-----------------------
    //查询所有床位
    @ApiOperation("查询所有床位")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "无",
//                    value = "无",
//                    required = false,
//                    dataType = "无"
//                    )
//    })
    @GetMapping("getAllHisBed")
    public Result<PageDTO<HisBedDto>> getAllHisBed();

    //查询床位表
    @ApiOperation("查询床位")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "id",
//                    value = "查询的参数",
//                    required = false,
//                    dataType = "arraylist" )
//    })
    @PostMapping("getHisBedBy")
    public Result<PageDTO<HisBedDto>> getHisBedBy(@RequestBody HisBedParam hisBedParam);

    //新增床位
    @ApiOperation("新增床位")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "hisBedAddParam",
//                    value = "床位对象",
//                    required = false,
//                    dataType = "hisBedAddParam")
//    })
    @PostMapping("addHisBed")
     Result<HisBedDto> addHisBed(@RequestBody HisBedAddParam hisBedAddParam);

    //修改床位
    @ApiOperation("修改床位")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "hisBedParam",
//                    value = "床位对象",
//                    required = false,
//                    dataType = "hisBedParam" )
//    })
    @PostMapping("updateHisBed")
    public Result<HisBedDto> updateHisBed(@RequestBody HisBedParam hisBedParam);

    //删除床位根据id
    @ApiOperation("根据id删除床位")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "id",
//                    value = "床位id",
//                    required = false,
//                    dataType = "ArrayList<Integer>" )
//    })
    @DeleteMapping("deleteHisBedById")
    public Result<Boolean> deleteHisBedById(@RequestParam("id") ArrayList<Integer> id);


}
